package com.jingbian.cppccbackend.mapper.user;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.jingbian.cppccbackend.entity.Users;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 * 用户信息表 Mapper 接口
 * </p>
 *
 * @author yezi
 * @since 2025-02-09
 */
@Mapper
public interface UsersMapper extends BaseMapper<Users> {

    @Select("select * from users where phone=#{phone} and is_active=true")
    Users getUserInfo(String phone);

    @Select("select * from users where openid = #{openid} and is_active=true")
    Users getByOpenid(String openid);

    List<Users> selectUsersByIds(@Param("userIds") List<Integer> signerIds);
}
